package org.liuqm.factory.simplefactory.sevice.impl;

import org.liuqm.factory.simplefactory.dao.UserDao;
import org.liuqm.factory.simplefactory.sevice.UserDaoFactory;
import org.liuqm.factory.simplefactory.sevice.UserService;

public class UserServiceImpl implements UserService {

    private String userType = "";

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        userDao=UserDaoFactory.createUserDao(userType);
        this.userType = userType;
    }

    UserDao userDao = UserDaoFactory.createUserDao(userType);

    /**
     * 保存用户的方法
     * @param userName
     * @param password
     * @return
     */
    @Override
    public int insertUser(String userName, String password) {
        userDao.insertUser(userName,password);
        return 0;
    }
}
